<#include "../common/common.ftl"/>
<table class="layui-table">
    <tr class="layui-bg-gray">
        <th style="text-align: center;">序号</th>
        <th style="text-align: center;">安置项目</th>
        <th style="text-align: center;">房源信息</th>
        <th style="text-align: center;">房屋类型</th>
        <th style="text-align: center;">总建筑面积</th>
        <th style="text-align: center;">所需安置面积(m²)</th>
        <th style="text-align: center;">备注</th>
        <th style="text-align: center;">操作</th>
    </tr>
<#list shopHouseList as shopHouse>
    <tr>
        <td style="text-align: center;">${shopHouse_index+1}</td>
        <td style="text-align: center;">${(shopHouse.azProject.projectName)!}</td>
        <td style="text-align: center;">${(shopHouse.houseNumStr)!}【${(shopHouse.floor)!}层】</td>
        <td style="text-align: center;">店铺</td>
        <td style="text-align: center;">${(shopHouse.buildArea)!}㎡【其中公摊<span
                class="jmdf-color-red">${(shopHouse.poolArea)!}㎡</span>】
        </td>
        <td style="text-align: center;"><span class="jmdf-color-red">${(shopHouse.sxZhArea)!}</span></td>
        <td style="text-align: center;">${(shopHouse.yjName)!}</td>
        <th style="text-align: center;">
            <#if (contract.chooseHouseStatus == 1)>
                <a class="layui-btn layui-btn-xs layui-btn-danger shopHouseDelete" buildNum="${(house.buildNum)!}"
                   houseNum="${(house.houseNum)!}" shopHouseId="${shopHouse.id}"><i
                        class="layui-icon layui-icon-delete"></i>撤销店铺</a>
            </#if>
        </th>
    </tr>
</#list>

<#--<tr class="layui-bg-gray">-->
<#--<td colspan="5" style="text-align: right;">合计：</td>-->
<#--<td style="text-align: center;"><span class="jmdf-color-red">${(contract.chooseHouseAreaTotal)!}</span></td>-->
<#--<td></td>-->
<#--<td style="text-align: center;"><span class="jmdf-color-red">${(contract.storageRoomArea)!}</span></td>-->
<#--<td></td>-->
<#--</tr>-->
</table>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['jquery', 'layer', 'jmdf'], function () {
        var $ = layui.jquery, layer = layui.layer, jmdf = layui.jmdf;

        $(".shopHouseDelete").click(function () {
            var obj = $(this);
            layer.open({
                title: false,
                shade: 0.5,
                content: "确定撤销【" + obj.attr("buildNum") + "幢" + obj.attr("houseNum") + "】店铺吗？",
                btn: ['确定', '取消'],
                closeBtn: 0,
                btnAlign: 'c'
                ,
                yes: function (index) {
                    $.get("shopHouseDelete", {
                        contractId: "${(contract.id)!}",
                        shopHouseId: obj.attr("shopHouseId"),
                        _time: new Date().getTime()
                    }, function (data) {
                        if (data.code == "0001") {//成功
                            layer.msg(data.message, {anim: 0, icon: 1, time: 1000});
                        } else {//失败
                            layer.msg(data.message, {anim: 6, icon: 2, time: 2000});
                        }
                        loadSelectShopHouseInfo("${(contract.id)!}");

                        //房源列表需重新刷新
                        loadSelectHouseInfo("${(contract.id)!}");
                    })
                }
            });
        });
    });
</script>